package com.cndym.utils;

import java.util.Date;

/**
 * User: 邓玉明 Date: 11-4-8 上午12:06
 */
public class OrderIdBuildUtils {
    public static String buildId(String begin) {
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append(new Date().getTime());
        StringBuffer orderId = new StringBuffer();
        orderId.append(begin);
        orderId.append(stringBuffer.substring(5));
        orderId.append(Utils.random(10));
        return orderId.toString();
    }
    
    public static String buildIdForTicketId(String begin) {
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append(new Date().getTime());
        StringBuffer orderId = new StringBuffer();
        orderId.append(begin);
        orderId.append(stringBuffer.substring(5));
        orderId.append(Utils.getRandomStr(10));
        return orderId.toString();
    }

    // 充值订单号
    public static String buildFillId() {
        return buildId("00");
    }

    // 提现订单号
    public static String buildDrawId() {
        return buildId("01");
    }

    // 订单号
    public static String buildOrderId() {
        return buildId("02");
    }

    // 票号
    public static String buildTicketId() {
        return buildIdForTicketId("03");
    }

    // 方案号
    public static String buildPrgramsOrderId() {
        return buildId("04");
    }

    // 外部订单号
    public static String buildOutOrderId() {
        return buildId("05");
    }

    // 追号方案号
    public static String buildAutoPrgramsOrderId() {
        return buildId("06");
    }

    // 额度调整号
    public static String buildDiyCountOrderId() {
        return buildId("07");
    }

    public static String buildPackageOrderId() {
        return buildId("08");
    }

    public static String queryBalanceOrderId() {
        return buildId("09");
    }

    public static String buildSubProgramsId() {
        return buildId("10");
    }

    public static String buildSaveProgramsId() {
        return buildId("11");
    }

    public static String buildSaveAlipayTransferDateilId() {
        return buildId("12");
    }

    public static String bulidSavaAlipayTransferRecordId() {
        return buildId("13");
    }

    public static String bulilSaveFileName() {
        return buildId("14");
    }

    public static String buildFillForCMBId() {
        StringBuffer time = new StringBuffer().append(new Date().getTime());
        return time.substring(time.length() - 10);
    }

    public static String buildPromotionTransId() {
        return buildId("15");
    }

    //临时订单号
    public static String buildTempOrderId() {
        return buildId("16");
    }

    public static String buildPresentOrderId(){
        return buildId("17");
    }
}
